<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.base.myproject.client.jdbc.*" %>
<%@ page language="java" import="com.base.myproject.server.*" %>
<%@ page language="java" import="com.base.myproject.client.jdbc.DataSet" %>
<%@ page language="java" import="com.base.myproject.server.tools.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>考勤记录查询报表</title>
<%
	String where = request.getParameter("where");
	StringBuilder sql = new StringBuilder();
	sql.append("select SSN as bcode,a.bname,b.employinnertitle,a.systemid,c.CHECKTIME,c.touse,c.sensorid, " +
			" c.checktype as outtype,c.remark " +
			" from bcode as a,bcode_job as b,attendance_view as c " +
			"where a.bcode=b.bcode and a.bcode=right(rtrim(c.SSN),4) ");
	sql.append(where);
	sql.append(" order by checktime desc");
	
	DataSetTool DST = new DataSetTool();
	DataSet recordDetail = DST.getDataSet(sql.toString());
%>
</head>
<body>
<table  style="border-collapse: collapse; font-size: 14px" cellspacing="0" cellpadding="0" border="1" width="100%" bordercolordark="#CCCCCC" bordercolorlight="#CCCCCC" style="line-height: 120%;border-color:#000000;font-size:10px">
	<tr  bgcolor="#e8e8e0" align="center">
		<td>员工编号</td>
		<td>姓名</td>
		<td>部门</td>
		<td>打卡时间</td>
		<td>进出类型</td>
		<td>打卡机器号</td>
		<td>备注</td>
	</tr>
	<% for (int i=0; i<recordDetail.getRowCount(); i++) { %>
		<tr align="center">
			<td><%= recordDetail.getValue(i, "bcode") %></td>
			<td><%= recordDetail.getValue(i, "bname") %></td>
			<td><%= recordDetail.getValue(i, "systemid") %></td>
			<td><%= recordDetail.getValue(i, "CHECKTIME") %></td>
			<td><%= recordDetail.getValue(i, "outtype") %></td>
			<td><%= recordDetail.getValue(i, "sensorid") %></td>
			<td><%= recordDetail.getValue(i, "remark") %></td>
		</tr>
	<% } %>
	
</table>
</body>
</html>